// SDLDrawManager.h: interface for the SDLDrawManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SDLDRAWMANAGER_H__58E1D374_FBF7_494A_937A_197C96AE1F1A__INCLUDED_)
#define AFX_SDLDRAWMANAGER_H__58E1D374_FBF7_494A_937A_197C96AE1F1A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include "Utils.h"

#define max 3000
#define menosinfinito -99999
#define masinfinito 99999
/// de aca van a desaparecer varias cosas tenganme paciencia...... 

typedef struct {
	double posX;
	double posY;
} tPunto;

typedef struct {
   int maxx[max];
   int minx[max];
   int x0, y0, x1, y1;
   int dx, dy, e, ix, iy;
} SDLDrawElement;


class SDLDrawManager  
{
   Uint8 cR;
   Uint8 cG;
   Uint8 cB;
		
public:
	SDLDrawManager();
	virtual ~SDLDrawManager();
	void bhmLine1_7(SDL_Surface *screen, SDLDrawElement * sdlElem);
	void bhmLine3_5(SDL_Surface *screen, SDLDrawElement * sdlElem);
   	void bhmScanLineFill(SDL_Surface *screen, SDLDrawElement * sdlElem);
	void swapPoints(SDLDrawElement * sdlElem);
	void bhmScanLine1_7(SDL_Surface *screen, SDLDrawElement * sdlElem);
	void bhmScanLine3_5(SDL_Surface *screen, SDLDrawElement * sdlElem);
	void bhmScanLineInit(SDL_Surface *screen, SDLDrawElement * sdlElem);	
	void drawPoint(SDL_Surface *screen, int x, int y);
	void setColor(SDL_Surface *screen, Uint8 r, Uint8 g, Uint8 b);
	void bhmScanLine(SDL_Surface *screen,int X0, int Y0, int X1, int Y1, SDLDrawElement * e);
    void clipTexture(SDL_Surface *screen, SDLDrawElement * sdlElem, int xMin, int yMin, int h, int w);
    void clipCircle(SDL_Surface *screen, int radio, Point v1);
    Uint32 getpixel(SDL_Surface *surface, int x, int y);
    void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
	void solveFilterColor(int r,int g, int * b);
	void refresh(SDL_Surface * screen, SDL_Surface * auxSurface);
    void resizeImage(SDL_Surface * imagen, SDL_Surface * auxSurface,int x ,int y,int base, int altura, Transformations T);
    void expandImage(SDL_Surface * surface, int  x, int  y, double xt, double yt,double xMinT,double yMinT,double xMaxT,double yMaxT, Uint32 uColor, double endX, double endY);
    SDL_Surface* createSurface(int w, int h,int resolution);

};



#endif // !defined(AFX_SDLDRAWMANAGER_H__58E1D374_FBF7_494A_937A_197C96AE1F1A__INCLUDED_)
